<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
		<meta name="author" content="金西振" />
		<title></title>
		<style>
      div{
        color: red;
      }

    </style>
	</head>
	<body>
		<div>div1</div>
		<div>div2</div>
		<div>div3</div>
		<div>div4</div>
		<div>div5</div>
		<div>div6</div>
		<script>
			// 让所有的div变黑
      var divs = document.querySelectorAll('div');
      for(var i = 0; i < divs.length; i++){
        divs[i].style.color = '#000';
      }
		</script>
	</body>
</html>
